import Vue from 'vue'
import VueRouter from 'vue-router'
// 一级路由
import Home from '../views/Home'
import Login from '../views/Login'
import Registe from '../views/Registe'
// 二级路由
import List from '../views/List'
import News from '../views/News'
import Profile from '../views/Profile'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: 'list',
        component: List
      },
      {
        path: 'news',
        component: News
      },
      {
        path: 'profile',
        component: Profile
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/registe',
    component: Registe,
    name: 'Registe'
  }
]

const router = new VueRouter({
  routes
})

export default router
